<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 class Artcate_model extends CI_Model
 {
     public $cid;
     public $ctitle;
    
     public function __construct()
     {
         parent::__construct();
         $this->load->database();
     }
     public function Get_ArtcateList_Page()
     {
     	return $this->db->select()->from('artcate')->where('cid>0')->get()->result();
     }
     public function Inset_Artcate()
     {
         return $this->db->insert('artcate',$this);
     }
     public function Get_ArtcateBy_Id($cid)
     {
     	return $this->db->select()->from('artcate')->where(array('cid'=>$cid))->get()->result();
     }
     public function EditArtcateBy($artcateModel)
     {
         $this->db->update('artcate',$artcateModel,array('cid'=>$artcateModel->cid));
         return $this->db->affected_rows();
     }
     public function DelArtcate_ById($cid)
     {
         $res= $this->db->delete('artcate',array('cid'=>$cid));
         return $this->db->affected_rows();
     }
 }
?>